
#ifndef DEF_HPP
#define DEF_HPP

#include <pcl/point_types.h>
#include <pcl/point_cloud.h>

using PT_TYPE   = pcl::PointXYZ; 
using PointT    = pcl::PointXYZ;
using PointXYZI = pcl::PointXYZI;
using PointCloudT = pcl::PointCloud<PointT>;
using PointType = pcl::PointXYZI;
using PointCloudXYZ = pcl::PointCloud<PointT>;

/*
A point cloud type that has 6D pose info ([x,y,z,roll,pitch,yaw] intensity is time stamp)
*/
struct PointXYZIRPYT
{
    PCL_ADD_POINT4D
    PCL_ADD_INTENSITY;                  // preferred way of adding a XYZ+padding
    float roll;
    float pitch;
    float yaw;
    double time;
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW   // make sure our new allocators are aligned
} EIGEN_ALIGN16;                    // enforce SSE padding for correct memory alignment

POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIRPYT,
                                   (float, x, x) (float, y, y)
                                   (float, z, z) (float, intensity, intensity)
                                   (float, roll, roll) (float, pitch, pitch) (float, yaw, yaw)
                                   (double, time, time))

typedef PointXYZIRPYT  PointTypePose;


// Velodyne
struct PointXYZIRT
{
    PCL_ADD_POINT4D
    PCL_ADD_INTENSITY;
    uint16_t ring;
    double time; // double for our bag, float for velodyne driver
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;

POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIRT,  
    (float, x, x) (float, y, y) (float, z, z) (float, intensity, intensity)
    (uint16_t, ring, ring) (double, time, time)
)

struct ImuData
{
    double stamp;
    Eigen::Vector3d    acc; //线加速度
    Eigen::Vector3d    gyr; //角速度
    Eigen::Vector3d    rpy; //累积的三个角
    Eigen::Quaterniond rot; //姿态
};

struct LidarFrame
{
    double stamp;
    Eigen::Matrix4d T;  //相对变换矩阵
    Eigen::Matrix4d gT; //累积后的变化矩阵，相对第一帧
    pcl::PointCloud<PT_TYPE> cloud; //只包含坐标信息的点云数据
    pcl::PointCloud<PointXYZIRT> rawCloud; //包含原始信息的点云数据
};



#endif

